//
//  STOrderPageViewController.swift
//  iPhone
//
//  Created by Toj on 11/17/22.
//

import UIKit

class STOrderPageViewController: UIViewController {

    var index: Int = 0
    
    private(set) lazy var button: UIButton = {
        let view = UIButton()
        view.setTitle("点击我进行push", for: .normal)
        view.addTarget(self, action: #selector(push), for: .touchUpInside)
        view.setTitleColor(UIColor.black, for: .normal)
        view.backgroundColor = UIColor.white
        return view
    }()

    override func viewDidLoad() {
        super.viewDidLoad()
        view.backgroundColor = .random
        
       // print("-->toj: " + #function + button.titleLabel!.text!)
        
        view.addSubview(button)
        button.snp.makeConstraints { (maker) in
            maker.center.equalToSuperview()
        }
    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        
        //print("-->toj: " + #function + button.titleLabel!.text!)
    }
    
    @objc private func push() {
        let controller = UIViewController()
        controller.view.backgroundColor = UIColor.white
        controller.hidesBottomBarWhenPushed = true;
        navigationController?.pushViewController(controller, animated: true)
    }

}
